﻿'Params
'tag (Required) : The tag name
'api_key (Required) : A Last.fm API key.
'Auth
'This service does not require authentication. 

Public Structure TagGetSimilarResponse
    Dim tags() As Tag

End Structure

Public Class TagGetSimilar
	Inherits BaseRequest
    Dim tag As String

	Public xmlresponse As XDocument = Nothing

    Public Sub New(ByVal tag As String)
        Me.tag = tag
    End Sub

	Public Sub sendRequest()
        InitializeMembers("tag.getSimilar")

        AddMember("tag", tag, False)

        xmlresponse = sendPOSTResponse()
	End Sub

    Public Function getResponse() As TagGetSimilarResponse
        Dim response As New TagGetSimilarResponse
        Dim count As New Integer
        Try
            count = xmlresponse.<lfm>.<similartags>.Count()
        Catch ex As Exception
        End Try

        If (count > 0) Then
            For i As Integer = 0 To count - 1
                response.tags(i) = New Tag(xmlresponse.<lfm>.<similartags>(i))
            Next
        End If

        Return response
    End Function
End Class
